Optimal. Leaf size=52 \[ -\frac {A x}{a}+\frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4170, 3872,
2717, 8} \begin {gather*} \frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}-\frac {A x}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2717
Rule 3872
Rule 4170
Rubi steps
\begin {align*} \int \frac {\cos (c+d x) \left (A+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \cos (c+d x) (-a (2 A+C)+a A \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {A \int 1 \, dx}{a}+\frac {(2 A+C) \int \cos (c+d x) \, dx}{a}\\ &=-\frac {A x}{a}+\frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(108\) vs. \(2(52)=104\).
time = 0.31, size = 108, normalized size = 2.08 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-2 A d x \cos \left (\frac {d x}{2}\right )-2 A d x \cos \left (c+\frac {d x}{2}\right )+5 A \sin \left (\frac {d x}{2}\right )+4 C \sin \left (\frac {d x}{2}\right )+A \sin \left (c+\frac {d x}{2}\right )+A \sin \left (c+\frac {3 d x}{2}\right )+A \sin \left (2 c+\frac {3 d x}{2}\right )\right )}{4 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.60, size = 73, normalized size = 1.40
method | result | size |
derivativedivides | \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 A \left (-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{d a}\) | \(73\) |
default | \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 A \left (-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{d a}\) | \(73\) |
risch | \(-\frac {A x}{a}-\frac {i A \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) | \(93\) |
norman | \(\frac {\frac {A x}{a}+\frac {\left (A +C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {2 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {A x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\left (3 A +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(120\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs.
\(2 (52) = 104\).
time = 0.51, size = 117, normalized size = 2.25 \begin {gather*} -\frac {A {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - \frac {C \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.27, size = 53, normalized size = 1.02 \begin {gather*} -\frac {A d x \cos \left (d x + c\right ) + A d x - {\left (A \cos \left (d x + c\right ) + 2 \, A + C\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {A \cos {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 74, normalized size = 1.42 \begin {gather*} -\frac {\frac {{\left (d x + c\right )} A}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.60, size = 59, normalized size = 1.13 \begin {gather*} \frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {A\,x}{a}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+C\right )}{a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________